Debug multiple C++ files "undefined reference" 路 Issue #6546 路 microsoft/vscode 您所在的位置:网站首页 vscode undefined reference Debug multiple C++ files "undefined reference" 路 Issue #6546 路 microsoft/vscode

Debug multiple C++ files "undefined reference" 路 Issue #6546 路 microsoft/vscode

2024-05-01 06:04| 来源: 网络整理| 查看: 265

The problem you have is that your tasks.json is not configured to build file.cpp.

I suggest that you use make in order to build multiple file projects.

For instance, in your case, I would suggest to have a tasks.json thus:

{ "label": "command": "make", "args": [ "CONF=Debug", "-C", "./.vscode" ] ...other stuff. }

What the above does is that it looks for Makefile in directory ./vscode and executes it. Your actual Makefile is going to have commands like g++ -g -o and such.

There are many tutorials on how to create makefiles. I would suggest that on linux, take the help of an ide (such as Netbeans) to create and compile this project. Then, within Netbeans project folder, you will be able to find sample Makefile-Debug.mk and Makefile-Release.mk files.

Then, what you need to do is to simply copy over those makefiles into your ./.vscode/ folder. That way, your build task in tasks.json will simply call make.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有